From: Jonas Dreßler Date: Thu, 24 Jul 2025 23:08:01 +0000 (+0200) Subject: status/thunderbolt: Connect to signals using connectObject X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~119^2~4^2^2~5 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4dec3f1accd1ac73f7b57f4e90f95ec395adaa17;p=gnome-shell.git status/thunderbolt: Connect to signals using connectObject To ensure that we disconnect from those signals when the Indicator goes away, use the `connectObject()` convenience function. This also allows removing the call to `disconnectAll()` in the AuthRobot `close()` method. Part-of: (cherry picked from commit 47965887d98c761ab89ce3f7a5ca937a35f61294) --- diff --git a/js/ui/status/thunderbolt.js b/js/ui/status/thunderbolt.js index f0ee7edf1..6c1400351 100644 --- a/js/ui/status/thunderbolt.js +++ b/js/ui/status/thunderbolt.js @@ -139,7 +139,6 @@ class AuthRobot extends Signals.EventEmitter { } close() { - this.disconnectAll(); this._client = null; } @@ -224,12 +223,14 @@ class Indicator extends SystemIndicator { this._indicator.icon_name = 'thunderbolt-symbolic'; this._client = new Client(); - this._client.connect('probing-changed', this._onProbing.bind(this)); + this._client.connectObject( + 'probing-changed', this._onProbing.bind(this), this); this._robot = new AuthRobot(this._client); - - this._robot.connect('enroll-device', this._onEnrollDevice.bind(this)); - this._robot.connect('enroll-failed', this._onEnrollFailed.bind(this)); + this._robot.connectObject( + 'enroll-device', this._onEnrollDevice.bind(this), + 'enroll-failed', this._onEnrollFailed.bind(this), + this); this.connect('destroy', () => this._onDestroy());